-
Couldn't load subscription status.
- Fork 50
[WIP-04] [Project Solar / Phase 1 / Showcase] Add support for theming and theme-switching to the showcase #3240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
didoo
wants to merge
54
commits into
project-solar/phase-1/HDS-5505_components/modes-css-compilation
Choose a base branch
from
project-solar/phase-1/HDS-5242_showcase/add-themes-support
base: project-solar/phase-1/HDS-5505_components/modes-css-compilation
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+24,794
−69
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9 tasks
b73dbf9 to
a4f41dd
Compare
a4f41dd to
cc61972
Compare
519a6a6 to
3863dfa
Compare
cc61972 to
59418c1
Compare
59418c1 to
2f20cdc
Compare
2f20cdc to
92910be
Compare
92910be to
a1ff2f5
Compare
…uce redundant methods invocations
Co-authored-by: Copilot <[email protected]>
…he states were potentially out of sync
Co-authored-by: Kristin Bradley <[email protected]>
…g) are consumed by the showcase application
Assertion Failed: You attempted to update _isInitialized on <HdsThemingService:ember77>, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
_isInitialized was first used:
While rendering:
{{outlet}} for -top-level
-top-level
{{outlet}} for application
Application
sq
while we understand how to do nesting of theming
2a2c290 to
d48811f
Compare
…`Theming` showcase page context: #3240 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This PR is quite large, we may consider splitting it up in multiple PRs
📌 Summary
This PR contains multiple pieces of the "theming" puzzle:
hdsThemingservice and a (temporary)HdsThemeSwitchercomponentshwThemingservice and set of showcase controls to switch theming (and theming options) plus the CSS file linked in the applicationThis is based on top of #3259
🛠️ Detailed description
The first commits are a direct porting of previous showcase theming explorations (squashed):
After the initial cherry picking of code, there's been a lot of back and forth / refactorings, with different attempts in reaching an implementation that could (hopefully) withstand how different teams may want to adopt theming in their codebases. For this reason, the bulk of the work has been around finding the right "location" for the different pieces of logic, the different concerns: what goes into the HDS theming service vs the SHW theming service; how theming preferences are expressed in the UI and controlled by the user; how consumers decisions are reflected and stored and passed over between HDS/SHW services and components; how a user would use the theming controls (including a showcase user/developer/designer) and how a consumer would allow that user to interact with the application.
It's impossible to describe in detail all the code changes and implementations introduced in this PR, you have to look at diff in code, the showcase application, the "how to review" and "how to test" sections below, and try to get a general picture of what went into this PR.
👉 👉 👉 Preview: theming page
🔎 How to review
This is a quite large PR (we may consider splitting it). I would suggest to look at a piece of code/logic (eg. HDS theming service), see how this interacts with the rest of the code (in HDS and/or in the showcase), and in parallel I would try to see in the showcase application how this logic is reflected in the UI, and try to interact with it to see what happens.
The "logical" order in which I would look at things is this:
hdsThemingservice andHdsThemeSwitchercomponent underpackages/componentsshwThemingservice undershowCaseand see how it's an extension of thehdsTheming(something we may undo, if we remove theglobalOnSetThemecallback, see below)ShwThemeSwitchercontrols (component and sub-components) and see how they're using internally both thehdsThemingandshwThemingservices, how the "current" theming options are reflected in the services and in the controls values/states, what happens when a control value is updated/applied, etcfoundations/themingshowcase page, and its sectionsHdsThemSwitchercomponentpublic/assets/styles/@hashicorp/folder, in particular the CSS selectors, and see if they make sense🛠️ How to test
Launch the showcase application locally, then visit the "Foundations > Theming" page. Here play with the controls in the top right of the page, and see how changing them impacts the page:
If you want to double check how the tokens and their values are applied depending on the chosen theme/options, you can update the colors in the temporary/testing CSS files under the
public/assets/styles/@hashicorp/folder (see the CSS variables under theadded these to test theming in the showcasecomment)💬 To discuss/decide
$modessupport to tokens pipeline #3239, where we set/write the CSS selectors in the actual themed token files)hds-theme-systemordata-hds-theme="system"when the user-selected option issystem?:not()selectors (see below)_currentStylesheetbe stored in local storage or in URL as query param (same for the othershwpreferences)?globalOnSetThemecallback? which use cases do we foresee?🗒️ TODOs
hdsThemingserviceHdsThemingcomponent:root:not([class*="hds-theme-"],[data-hds-theme])(it may not work, if we usehds-theme-systemordata-hds-theme="system")public/assets/styles/@hashicorp/folder and replace them with a proper implementation based on the Ember build process📸 Screenshots
Screen.Recording.2025-10-21.at.15.31.39.mov
🔗 External links
Jira tickets:
👀 Component checklist
A changelog entry was added via Changesets if needed (see templates here)💬 Please consider using conventional comments when reviewing this PR.
📋 PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.